/* 全局样式 */
:root {
    --primary-color: #0366d6;
    --secondary-color: #24292e;
    --accent-color: #2ea44f;
    --text-color: #24292e;
    --text-light: #586069;
    --bg-color: #ffffff;
    --bg-light: #f6f8fa;
    --border-color: #e1e4e8;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
    --radius: 6px;
    --container-width: 1200px;
}

/* 暗色主题变量 */
[data-theme="dark"] {
    --primary-color: #58a6ff;
    --secondary-color: #0d1117;
    --accent-color: #3fb950;
    --text-color: #c9d1d9;
    --text-light: #8b949e;
    --bg-color: #0d1117;
    --bg-light: #161b22;
    --border-color: #30363d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    transition: var(--transition);
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 16px;
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
}

.btn.primary:hover {
    background-color: var(--primary-color);
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn.secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn.secondary:hover {
    background-color: rgba(3, 102, 214, 0.1);
    transform: translateY(-2px);
}

.section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 36px;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.underline {
    height: 4px;
    width: 70px;
    background-color: var(--primary-color);
    margin: 0 auto;
    border-radius: 2px;
}

.gray-bg {
    background-color: var(--bg-light);
}

/* 导航栏样式 */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--bg-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo a {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-item {
    color: var(--text-color);
    font-weight: 500;
    position: relative;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-item:hover::after,
.nav-item.active::after {
    width: 100%;
}

.theme-switch {
    cursor: pointer;
    font-size: 20px;
    color: var(--text-color);
    transition: var(--transition);
}

.theme-switch:hover {
    color: var(--primary-color);
    transform: rotate(30deg);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--text-color);
    border-radius: 3px;
    transition: var(--transition);
}

/* 英雄区域样式 */
.hero {
    padding: 180px 0 100px;
    background-color: var(--bg-light);
    position: relative;
    overflow: hidden;
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-content {
    flex: 1;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-container {
    position: relative;
    border-radius: 50%;
    padding: 8px;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    box-shadow: var(--shadow);
}

.profile-image {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-color);
}

.status-indicator {
    position: absolute;
    bottom: 30px;
    right: 0;
    background-color: var(--accent-color);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow);
}

.hero h1 {
    font-size: 48px;
    line-height: 1.2;
    margin-bottom: 15px;
}

.hero h2 {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.hero p {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 30px;
    max-width: 500px;
}

.highlight {
    color: var(--primary-color);
}

.cta-buttons {
    display: flex;
    gap: 15px;
}

/* 关于我部分 */
.about-content {
    display: flex;
    align-items: center;
    gap: 60px;
}

.about-text {
    flex: 1;
}

.about-image {
    flex: 1;
}

.about-image img {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.about-image img:hover {
    transform: scale(1.02);
}

.about-text p {
    margin-bottom: 20px;
    color: var(--text-light);
    font-size: 17px;
}

.stats {
    display: flex;
    gap: 30px;
    margin-top: 40px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 16px;
    color: var(--text-light);
}

/* 技能部分 */
.skills-container {
    display: flex;
    flex-direction: column;
    gap: 50px;
}

.skill-category h3 {
    margin-bottom: 30px;
    font-size: 24px;
    position: relative;
    display: inline-block;
}

.skill-category h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.skill-item {
    background-color: var(--bg-color);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.skill-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.skill-item::before {
    content: attr(data-skill);
    position: absolute;
    top: -30px;
    right: -30px;
    font-size: 100px;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.03);
    transition: var(--transition);
}

.skill-item:hover::before {
    transform: scale(1.2);
}

.skill-icon {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.skill-item h4 {
    font-size: 18px;
    margin-bottom: 15px;
}

.skill-level {
    height: 8px;
    background-color: var(--bg-light);
    border-radius: 4px;
    margin-bottom: 5px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 4px;
    transition: width 1.5s ease-in-out;
}

.skill-percent {
    font-size: 14px;
    color: var(--text-light);
    text-align: right;
    display: block;
}

/* 项目部分 */
.project-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    background-color: var(--bg-light);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-light);
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: var(--bg-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.project-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-links {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(3, 102, 214, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-links {
    opacity: 1;
}

.project-link {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary-color);
    font-size: 18px;
    transition: var(--transition);
}

.project-link:hover {
    transform: scale(1.1);
}

.project-info {
    padding: 25px;
}

.project-info h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.project-info p {
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 15px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.project-tech span {
    padding: 5px 12px;
    background-color: var(--bg-light);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
}

.view-more {
    text-align: center;
    margin-top: 50px;
}

/* 经历部分 */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50px;
    height: 100%;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-left: 100px;
    margin-bottom: 50px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 44px;
    top: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 3px solid var(--bg-color);
    z-index: 1;
}

.timeline-date {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    text-align: right;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
}

.timeline-content {
    background-color: var(--bg-color);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.timeline-content h3 {
    font-size: 20px;
    margin-bottom: 5px;
}

.timeline-content h4 {
    font-size: 16px;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 500;
}

.timeline-content p {
    margin-bottom: 15px;
    color: var(--text-light);
}

.timeline-content ul {
    padding-left: 20px;
}

.timeline-content ul li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 15px;
    color: var(--text-light);
}

.timeline-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--primary-color);
}

/* 联系部分 */
.contact-container {
    display: flex;
    gap: 50px;
}

.contact-info,
.contact-form {
    flex: 1;
}

.contact-info h3 {
    font-size: 28px;
    margin-bottom: 20px;
}

.contact-info p {
    color: var(--text-light);
    margin-bottom: 30px;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 15px;
}

.contact-method i {
    width: 50px;
    height: 50px;
    background-color: rgba(3, 102, 214, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    color: var(--primary-color);
}

.contact-method h4 {
    font-size: 18px;
    margin-bottom: 5px;
}

.contact-method p {
    margin-bottom: 0;
    color: var(--text-light);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-light);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    font-size: 18px;
    transition: var(--transition);
}

.social-link:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: inherit;
    font-size: 16px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.2);
}

/* 页脚 */
footer {
    background-color: var(--secondary-color);
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.footer-logo a {
    color: white;
    font-size: 24px;
    font-weight: 700;
}

.footer-nav {
    display: flex;
    gap: 20px;
}

.footer-nav a {
    color: #a0aec0;
    transition: var(--transition);
}

.footer-nav a:hover {
    color: white;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.footer-social .social-link {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.footer-social .social-link:hover {
    background-color: var(--primary-color);
}

.copyright {
    text-align: center;
    color: #a0aec0;
    font-size: 14px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 滚动到顶部按钮 */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.scroll-top.active {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background-color: var(--primary-color);
    transform: translateY(-5px);
}

/* 动画效果 */
.animate-text {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .hero .container {
        flex-direction: column-reverse;
        text-align: center;
    }

    .hero-content {
        margin-top: 40px;
    }

    .hero p {
        margin: 0 auto 30px;
    }

    .cta-buttons {
        justify-content: center;
    }

    .about-content {
        flex-direction: column;
    }

    .about-text {
        order: 2;
    }

    .about-image {
        order: 1;
        margin-bottom: 40px;
    }

    .stats {
        justify-content: center;
    }

    .contact-container {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 70px 0;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: var(--bg-color);
        flex-direction: column;
        gap: 0;
        height: 0;
        overflow: hidden;
        transition: var(--transition);
        box-shadow: 0 10px 10px rgba(0, 0, 0, 0.05);
    }

    .nav-links.active {
        height: auto;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links li a {
        display: block;
        padding: 15px 20px;
        border-bottom: 1px solid var(--border-color);
    }

    .menu-toggle {
        display: flex;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .footer-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 36px;
    }

    .hero h2 {
        font-size: 24px;
    }

    .profile-image {
        width: 250px;
        height: 250px;
    }

    .section-header h2 {
        font-size: 28px;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .stats {
        flex-direction: column;
        gap: 20px;
    }

    .project-filters {
        flex-direction: column;
        align-items: center;
    }

    .filter-btn {
        width: 100%;
        text-align: center;
    }
}